#include <stdio.h>
#include <stdbool.h>

bool isPrime(unsigned int num){
	for(unsigned int i = 2; i < num / 2 + 1; i++){
		if(num % i == 0){
			return false;
		}
	}
	return true;
}
int main(){
	unsigned int N = 0, number = 0;
	unsigned int next = 2, prev = 2;
	printf("请输入一个数: \n");
	scanf("%d", &N);
	
	for(unsigned int i = 2; i <= N; i++){
		if(!isPrime(i)){
			continue;
		}
		else{
			prev = next;
			next = i;
		}
		if(next - prev == 2){
			number++;
		}
	}
	printf("%d\n", number);
}
